package com.woniuxy.platform.core.controller;


import com.woniuxy.common.CommonResult;
import com.woniuxy.platform.core.model.PmMenu;
import com.woniuxy.platform.core.service.PmMenuService;
import com.woniuxy.platform.core.vo.PmMenuVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gmx
 * @since 2021-07-06
 */
@RestController
@RequestMapping("/pmMenu")
@Api(tags = "所有菜单列表")
public class PmMenuController {

    @Resource
    private PmMenuService pmMenuService;

    @GetMapping("selectMenu")
    @ApiOperation("查询菜单列表")
    public CommonResult selecrMenu(){
        List<PmMenuVo> list = this.pmMenuService.selectAllMenu();
        if (list == null){
            return CommonResult.fail("查询菜单列表失败");
        }
        return CommonResult.success(list);
    }

}

